define(function(require, exports){
	var pubjs = require('pubjs');
	var grid  = require('@base/highGrid');

	// 广告位管理
	var AdPositions = grid.base.extend({
		init: function(config){
			config = pubjs.conf(config, {
					url: 'spot/monitorList',
					cols: [
						{name:'op',text:LANG("操作"), type: 'op'},
						{name:'_id',text:"ID", sort: true},
						{name:'Name',text:LANG("广告位名称"), type:'index', width: 200},
						{name:'Size',text:LANG("尺寸"),  width: 80, render: 'renderSize'}
					],
					// metrics: ["{front}","{back}","{conversion}","{cost}", ""],
					default_metrics : [
						"AdvisePrice", "ads_type", "impressions","clicks","click_rate","click_reach_rate",
						"back_pageviews",
						"back_regs","back_reg_rate",
						"end_cpc","end_cpm","end_cpa","cost"
					],
					reqType: 'websocket',
					exportPara: 'medium',
					gridName: 'spot'
				}
			);
			this.Super('init', arguments);
		},
		renderSize: function(i, val){
			if(val) {
				return Math.floor(val/10000) + '*' + (val % 10000);
			}
			else {
				return '-';
			}
		}

	});
	exports.base = AdPositions;
});